﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FoundationLib.AddIns.Constraints
{
	/// <summary>
	/// Provides a global context for this add-in
	/// </summary>
	internal class Context
	{
		private string resourcePrefix;
		private static Context current;

		/// <summary>
		/// Gets or sets a prefix to use when retrieving formats from resources
		/// </summary>
		public string ResourcePrefix
		{
			get
			{
				return this.resourcePrefix;
			}
			set
			{
				this.resourcePrefix = value;
			}
		}

		private Context(string resourcePrefix)
		{
			this.resourcePrefix = resourcePrefix;
		}

		/// <summary>
		/// Returns the current context
		/// </summary>
		internal static Context Current
		{
			get
			{
				if (current == null)
					current = new Context("Contract");
				return current;
			}
		}
	}
}
